package com.yanqu.road.entity.kowloon;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.FieldTypeAnnotation;

/**
 * 九龙城寨好汉数据
 */
@FieldTypeAnnotation(tableName = "t_u_kowloon_hero_data", desc = "九龙城寨好汉数据")
public class KowloonHeroData extends DataObject {

    @FieldTypeAnnotation(desc = "用户ID", select = true, update = true)
    private long userId;

    @FieldTypeAnnotation(desc = "好汉id")
    private int heroId;

    @FieldTypeAnnotation(desc = "好汉等级")
    private int level;

//    @FieldTypeAnnotation(desc = "好汉属性（养成属性）")
    @JSONField(serialize = false)
    private KowloonNpcAttributeData attributeData = new KowloonNpcAttributeData();

    @FieldTypeAnnotation(desc = "好汉所在位置, -1 为未上阵")
    private int heroIdx;

    @FieldTypeAnnotation(desc = "更新时间")
    private long updateTime;

    public long getUserId() {
        return userId;
    }
    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }
    }

    public int getHeroId() {
        return heroId;
    }
    public void setHeroId(int heroId) {
        if (this.heroId != heroId) {
            this.heroId = heroId;
            setOp(DataStatus.Update);
        }
    }

    public int getLevel() {
        return level;
    }
    public void setLevel(int level) {
        if (this.level != level) {
            this.level = level;
            setOp(DataStatus.Update);
        }
    }

    public KowloonNpcAttributeData getAttributeData() {
        return attributeData;
    }

    public void setAttributeData(KowloonNpcAttributeData attributeData) {
        if (attributeData == null) {
            return;
        }
        this.attributeData = attributeData;
        setOp(DataStatus.Update);
    }

    public int getHeroIdx() {
        return heroIdx;
    }

    public void setHeroIdx(int heroIdx) {
        this.heroIdx = heroIdx;
    }

    public long getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(long updateTime) {
        if (this.updateTime != updateTime) {
            this.updateTime = updateTime;
            setOp(DataStatus.Update);
        }
    }


}
